package com.cloud.code.stream;

import lombok.SneakyThrows;

import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.stream.Stream;

public class StreamFiles {

    @SneakyThrows
    public static void main(String[] args) {

        Path path = Paths.get("D:\\IDEAWORK\\cloud\\cloud-ztest\\src\\main\\java\\com\\cloud\\code\\stream\\name.txt");

        Stream<String> lines = Files.lines(path, StandardCharsets.UTF_8);

        lines.forEach(System.out::println);

    }
}
